package com.hsteach.web.controller.meeting;

import com.hsteach.common.core.controller.BaseController;
import com.hsteach.common.core.domain.AjaxResult;
import com.hsteach.common.core.page.TableDataInfo;
import com.hsteach.enums.ApplyTypeEnum;
import com.hsteach.service.buildingApply.BuildingReviewPersonService;
import com.hsteach.web.controller.buildingApply.dto.ListBuildingReviewPersonDto;
import com.hsteach.web.controller.buildingApply.dto.UpdateBuildingReviewPersonDto;
import com.hsteach.web.controller.buildingApply.vo.ListBuildingReviewPersonVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 会议申请审核人员配置Controller
 * 弃用
 * @author fanxquer
 * @date 2023-08-27
 */
@Api(value = "会议申请审核人员配置", tags = "会议申请审核人员配置")
@RestController
@RequestMapping("/meeting/config")
@Deprecated
public class MeetingReviewPersonController extends BaseController
{
    @Autowired
    private BuildingReviewPersonService buildingReviewPersonService;

    /**
     * 查询场馆申请审核人员配置列表
     */
    @ApiOperation("查询场馆申请审核人员配置列表")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody ListBuildingReviewPersonDto dto)
    {
        List<ListBuildingReviewPersonVo> list = buildingReviewPersonService.listBuildingReviewPerson(dto, ApplyTypeEnum.MEETING);
        return getDataTable(list);
    }

    /**
     * 配置审核人员
     */
    @ApiOperation("配置审核人员")
    @PutMapping
    public AjaxResult edit(@RequestBody UpdateBuildingReviewPersonDto dto)
    {
        return toAjax(buildingReviewPersonService.updatePerson(dto, ApplyTypeEnum.MEETING));
    }

    /**
     * 删除场馆申请审核人员配置
     */
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(buildingReviewPersonService.deleteBuildingReviewPersonByIds(ids));
    }
}
